/**
 * 
 */
package candy;

import java.util.Comparator;

/**
 * @author 
 *
 */
public class SortedByPrice implements Comparator <Sweet> {

	@Override
	public int compare(Sweet arg0, Sweet arg1) {
		double price0 = arg0.getPrice();
		double price1 = arg1.getPrice();
		if (price0 > price1){
			return 1;
		}
		else if (price0 < price1){
			return -1;
		}
		else{
			return 0;
		}
		
	}

}
